package poubelle.html;

public class HTMLImg extends THTML{

	private String startWidget = "<img";
	private String endWidget = " />";
	private String nameWidget = " class=\"";
	private String onClick = " onclick=\"javascript:clic(";
	private String src = " src=\"";
	private String title = " title=\"";
	private String fonctionClick;

	@Override
	protected String getStartWidget() {
		return startWidget + nameWidget + src + title + 
				 ((fonctionClick != null) ? onClick : "");
	}

	@Override
	protected void setStartWidget(String startWidget) {
		this.startWidget = startWidget;
	}

	@Override
	protected String getEndWidget() {
		// TODO Auto-generated method stub
		return endWidget;
	}

	@Override
	protected void setEndWidget(String endWidget) {
		// TODO Auto-generated method stub
		this.endWidget = endWidget;
	}

	@Override
	protected String getNameWidget() {
		return nameWidget;
	}

	@Override
	protected void setNameWidget(String nameWidget) {
		// TODO Auto-generated method stub
				this.nameWidget = ((nameWidget != null) ? this.nameWidget + nameWidget
						+ "\"" : "");
	}
	
	protected void setOnClickWidget(String fonction) {
		fonctionClick = fonction;
		this.onClick = ((fonction != null) ? this.onClick + fonction + ");\""
				: "");
	}

	public void setSrcWidget(String src) {
		this.src = ((src !=null) ? this.src+src+"\"" : "");
	}

	public void setTitleWidget(String title) {
		this.title = ((title !=null) ? this.title+title+"\"" : "");
	}
}
